package MyQueue;

import java.util.LinkedList;
import java.util.Queue;

/**
 * Description:
 * Date: 2025-11-10
 * Time: 17:35
 */
public class Test {

    public static void main1(String[] args) {
        Queue<Integer> queue = new LinkedList<>();
        queue.offer(12);
        queue.offer(23);
        queue.offer(34);
        queue.offer(45);
        System.out.println(queue);
        System.out.println(queue.size());

        System.out.println(queue.peek());
        System.out.println(queue.poll());
        System.out.println(queue.peek());
        System.out.println(queue.isEmpty());
    }

    public static void main2(String[] args) {
        SingleLinkedList list = new SingleLinkedList();
        list.offer(12);
        list.offer(23);
        list.offer(34);
        list.offer(45);
        list.offer(56);
        list.display();
        System.out.println(list.size());

        System.out.println(list.peek());
        System.out.println(list.poll());
        System.out.println(list.peek());
        /*System.out.println(list.poll());
        System.out.println(list.poll());
        System.out.println(list.poll());
        System.out.println(list.poll());*/

        System.out.println(list.isEmpty());
    }

    public static void main(String[] args) {
        DoubleLinkedList list = new DoubleLinkedList();
        list.offer(12);
        list.offer(23);
        list.offer(34);
        list.offer(45);
        list.offer(56);
        list.display();
        System.out.println(list.size());

        System.out.println(list.peek());
        System.out.println(list.poll());
        System.out.println(list.peek());
        list.display();
        /*System.out.println(list.poll());
        System.out.println(list.poll());
        System.out.println(list.poll());
        System.out.println(list.poll());*/

        System.out.println(list.isEmpty());

    }
}
